Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subject id search #4881

Merged
merged 7 commits into from
Sep 19, 2024
Merged

Subject id search #4881

merged 7 commits into from
Sep 19, 2024

Conversation

dnil
Copy link
Collaborator

@dnil dnil commented Sep 19, 2024

This PR adds a functionality or fixes a bug.

Testing on cg-vm1 server (Clinical Genomics Stockholm)

Prepare for testing

  1. Make sure the PR is pushed and available on Docker Hub
  2. Fist book your testing time using the Pax software available at https://pax.scilifelab.se/. The resource you are going to call dibs on is scout-stage and the server is cg-vm1.
  3. ssh <USER.NAME>@cg-vm1.scilifelab.se
  4. sudo -iu hiseq.clinical
  5. ssh localhost
  6. (optional) Find out which scout branch is currently deployed on cg-vm1: podman ps
  7. Stop the service with current deployed branch: systemctl --user stop scout.target
  8. Start the scout service with the branch to test: systemctl --user start scout@<this_branch>
  9. Make sure the branch is deployed: systemctl --user status scout.target
  10. After testing is done, repeat procedure at https://pax.scilifelab.se/, which will release the allocated resource (scout-stage) to be used for testing by other users.
Testing on hasta server (Clinical Genomics Stockholm)

Prepare for testing

  1. ssh <USER.NAME>@hasta.scilifelab.se
  2. Book your testing time using the Pax software. us; paxa -u <user> -s hasta -r scout-stage. You can also use the WSGI Pax app available at https://pax.scilifelab.se/.
  3. (optional) Find out which scout branch is currently deployed on cg-vm1: conda activate S_scout; pip freeze | grep scout-browser
  4. Deploy the branch to test: bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_scout -t scout -b <this_branch>
  5. Make sure the branch is deployed: us; scout --version
  6. After testing is done, repeat the paxa procedure, which will release the allocated resource (scout-stage) to be used for testing by other users.

How to test:

  1. how to test it, possibly with real cases/data

Expected outcome:
The functionality should be working
Take a screenshot and attach or copy/paste the output.

Review:

  • code approved by CR
  • tests executed by DN

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.77%. Comparing base (cc4f98b) to head (bba815e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4881   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files         319      319           
  Lines       19296    19296           
=======================================
  Hits        16358    16358           
  Misses       2938     2938           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dnil dnil marked this pull request as ready for review September 19, 2024 13:23
Copy link

sonarcloud bot commented Sep 19, 2024

@dnil
Copy link
Collaborator Author

dnil commented Sep 19, 2024

Unfortunately we can't quite index this fully as it is: the name query is for all collaborators, and for all individuals and we can't index on both arrays simultaneously. Fortunately the collection is pretty small and the individuals array is short so this should work out anyway.

@@ -145,11 +145,18 @@
"case": [
IndexModel([("synopsis", TEXT)], default_language="english", name="synopsis_text"),
IndexModel([("causatives", ASCENDING)], name="causatives"),
IndexModel([("suspects", ASCENDING)], name="suspects"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed this one missing in passing.

@@ -167,6 +167,7 @@ def _set_case_name_query(self, query: Dict[str, Any], query_term: str):
query["$or"] = [
{"display_name": case_name_regex},
{"individuals.display_name": case_name_regex},
{"individuals.subject_id": case_name_regex},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change, really.

Copy link
Member

@northwestwitch northwestwitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Did you test it?

@dnil
Copy link
Collaborator Author

dnil commented Sep 19, 2024

Yep, tested both indexes and subject_id search locally. Will take it to stage for a spin as well before merging.

Screenshot 2024-09-19 at 15 02 04

@dnil
Copy link
Collaborator Author

dnil commented Sep 19, 2024


Screenshot 2024-09-19 at 15 49 02

Screenshot 2024-09-19 at 15 55 46

@dnil dnil merged commit c73ea6b into main Sep 19, 2024
26 checks passed
@dnil dnil deleted the subject_id_search branch September 19, 2024 13:52
dreamweaver-cell pushed a commit to gmc-norr/scout that referenced this pull request Oct 9, 2024
* Fix  Clinical-Genomics#4878 - search subject id, add supporting indicies

* changelog

* add a couple of commas

* actually spell

* query is for collaborators and individuals. cant do dual array indicies yet.

---------

Co-authored-by: Chiara Rasi <[email protected]>
dreamweaver-cell pushed a commit to dreamweaver-cell/scout that referenced this pull request Oct 13, 2024
* Fix  Clinical-Genomics#4878 - search subject id, add supporting indicies

* changelog

* add a couple of commas

* actually spell

* query is for collaborators and individuals. cant do dual array indicies yet.

---------

Co-authored-by: Chiara Rasi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants